﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FarseerPhysics.Dynamics;
using FarseerPhysics.Dynamics.Contacts;
using Animation;
using MapLibrary.Players;
using MapLibrary;
using AI;

namespace Enemies
{
    class Germ : Enemy
    {


        public Germ()
        {
            maxHealth = 150;
            health = maxHealth;

            Hookable = false;
        }

        public override bool MyOnCollision(Fixture f1, Fixture f2, Contact contact)
        {
            Sprite s1 = f1.Body.UserData as Sprite;
            Sprite s2 = f2.Body.UserData as Sprite;

            Player p = s2 as Player;

            if (p != null)
            {
                p.DealDamage(20);
            }
            else if (s1 != null)
            {
                if (s1 as Germ != null)
                {
                    GermBot b = Bot as GermBot;
                    b.ChangeDirection();
                }
            }

            LevelCollisionRegion lcr = f2.Body.UserData as LevelCollisionRegion;
            if (lcr != null)
            {
                if (lcr.Type.Equals("Wall"))
                {
                    GermBot b = Bot as GermBot;
                    b.ChangeDirection();
                }
            }

            return true;
        }
    }
}
